﻿@model ThaireInvestmentWeb.Models.ManageUnitTrustPrivilegeModel
@{
    ViewBag.Title = "ManageUnitTrustPrivilege";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<table class="navi" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width: 100%;">
            <div class="navi">
                Instrument Type > <a href="@Url.Action("ManageUnitTrust", "UnitTrust", new { headerId = @Model.HeaderID })">Unit Trust</a> > <a href="@Url.Action("EditUnitTrustHeader", "UnitTrust", new { headerId = @Model.HeaderID })">Header</a> > ข้อมูลสิทธิประโยชน์ 
            </div>
        </td>
    </tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableheader" width="100%">
    <tr>
        <td height="38" tyle="width: 100%; text-align: center;">Unit Trust : Detail ข้อมูลสิทธิประโยชน์</td>
    </tr>
</table>
<table style="width: 100%; text-align: center;">
    <tr>
        <td>
            @Html.Partial("_UnitTrustHeaderView", Model.HeaderDTO)

            <table width="95%" border="0" align="center">
                <tr>
                    <td>
                        <div align="left">
                            <input  type="button" name="Submit42" class="btsub" value="  New  " onclick="self.location.href = 'AddUnitTrustPrivilege?headerId=@Model.HeaderID    ';">
                            &nbsp;&nbsp;&nbsp;
                        </div>
                    </td>
                    <td>
                        <div align="right">
                            &nbsp;
                        </div>
                    </td>
                </tr>
            </table>
            <div style="width: 930px; overflow: auto;">
                @if (Model.Privileges != null)
                {
                    var grid = new WebGrid(source: Model.Privileges);
                    @grid.GetHtml(tableStyle: "tablelist", headerStyle: "headertable", displayHeader: @Model.Privileges.Count > 0,
                            columns: grid.Columns(
                                grid.Column(header: "NO.", format: item => item.WebGrid.Rows.IndexOf(item) + 1, canSort: false),
                                grid.Column(columnName: "CreateDate", header: "Create Date", canSort: false),
                                grid.Column(columnName: "PrivilegeTypeName", header: "Type", canSort: false),
                                grid.Column(columnName: "EXDate", header: "Ex-Date", canSort: false),
                                grid.Column(columnName: "PaymentDate", header: "Payment Date", canSort: false),
                                grid.Column(header: "Detail", format:
                                        @<text>
                                    <input type="image" onClick="go('@Url.Action("EditUnitTrustPrivilege", "UnitTrust", new { privilegeId = item.ID })    ');" src="@Url.Content("~/Content/images/b_edit.gif")"  title="แก้ไข (update)">
                                    </text>))
                                );
                }
            </div>
            <table width="95%" border="0" align="center">
                <tr>
                    <td>
                        <div align="center">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                        </div>
                    </td>
                </tr>
            </table>

        </td>
    </tr>
</table>
